package otl.overlay;

import processing.core.*;

@SuppressWarnings("serial")
public class Overlay extends PApplet{

	PApplet parent;
	
	//basic shapes
	PShape maskZone;
	
	
	int interfaceZoneWidth = 300;
	int headerZoneHeight = 100;
	int footerZoneHeight = 80;
	int	leftPaddingWidth = 25;
	
	
	//colour settings
	int transparencyLevel = 230; // 0 = trans, 255 = opaque
	
	public Overlay(PApplet p){
		//println("making Mask");
		parent = p;
		
		maskZone = parent.createShape();
		maskZone.beginShape();
			maskZone.fill(0, transparencyLevel);
			maskZone.noStroke();
			maskZone.vertex(0, 0); //v1
			maskZone.vertex(p.width, 0); //v2
			maskZone.vertex(p.width, p.height);//v3
			maskZone.vertex(0, p.height); //v4
			maskZone.vertex(0, headerZoneHeight); //v5
			maskZone.vertex(leftPaddingWidth, headerZoneHeight); //v6
			maskZone.vertex(leftPaddingWidth, p.height - footerZoneHeight); //v7
			maskZone.vertex(p.width - interfaceZoneWidth, p.height - footerZoneHeight); //v8
			maskZone.vertex(p.width - interfaceZoneWidth, 0 + headerZoneHeight); //v9
			maskZone.vertex(0, headerZoneHeight); //v10
		maskZone.endShape(CLOSE);
	}
	
	public void drawMask(){
		//println("drawing Mask...");
		//parent.fill(0, 0, 0, 80);
		//parent.noStroke();
		//parent.fill(0, 80);
		//parent.shape(headerZone,0,0);
		parent.shape(maskZone,0,0);
		parent.fill(255);
		parent.text("ON THE LINE", 20, 20);
	}
}
